<template>
  <div class="ts-cashManager">
    <ts-header title="提现管理" custom @onBack="onBack">
      <router-link to="/manager/meansManager" class="cash-means-link" slot="right">提现方式</router-link>
    </ts-header>
    <div class="cash-money-limit">
      <p class="cash-tips">可提现金额(元)</p>
      <p class="cash-limit">{{money.price_num}}</p>
    </div>
    <div class="cash-submit">
      <ts-button v-show="money.price_num>0" type="primary" size="large" @click="$router.push('cashing')">提现</ts-button>
      <ts-button v-show="money.price_num<=0" type="primary" disabled size="large">提现</ts-button>
    </div>
  </div>
</template>

<script>
import { GET_WITHDRAWALS } from '../../assets/js/api'

export default {
  name: 'cashManager',
  data() {
    return {
      money: {
        price_num: 0
      }
    }
  },
  async created() {
    const json = await this.$http.post(GET_WITHDRAWALS);
    if (json.result === 1) {
      if (json.data.money === null) {
        return
      }
      this.money.price_num = json.data.money;
    }
  },
  methods: {
    onBack(){
//      this.$router.replace({name: 'profile'})
      this.$router.goBack();
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../assets/css/mixin";
@import "../../assets/css/variables";

.ts-cashManager {
  .cash-means-link {
    @include sc(.28rem, #5D5D5D);
  }
  .cash-money-limit {
    padding: 1.75rem 0 2.70rem;
    text-align: center;
    color: #131313;
    .cash-tips {
      font-size: .30rem;
    }
    .cash-limit {
      margin-top: .20rem;
      font-size: .90rem;
      font-weight: bold;
    }
  }
  .cash-submit {
    padding: 0 .75rem;
    .large {
      height: 1.00rem;
    }
  }
}
</style>
